<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<mesoBoard.Data.User>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <fieldset>
        <legend><%= Html.ThemeImage("user.png") %> Users</legend>
        
        <table class="form_table">    
            <tr>
                <th>Username</th>
                <th>Email</th>
                <th>Status</th>
                <th>Last Login</th>
            </tr>
            
            <% int i = 0;
               foreach(User u in Model){ %>
                <tr class="<%= i++ % 2 == 0 ? "" : "bg_color3" %>">
                    <td><%= Html.ActionLink(u.Username, "UserDetails", new { UserID = u.UserID }) %></td>
                    <td><%= u.Email %></td>
                    <td><%= string.IsNullOrEmpty(u.ActivationCode) ? "<span class='active'>Active</span>" : "<span class='inactive'>Inactive</span>" %></td>
                    <td><%= Html.RelativeDate(u.LastLoginDate) %> from <%= u.LastLoginIP %></td>
                </tr>
            <%} %>
        </table>
        
    </fieldset>

</asp:Content>
